<template>
	<view class="box-con">
		<view class="box-con-title">手机号</view>
		<input @input="inputPhone" class="box-con-input" maxlength="11" placeholder="请填写手机号" type="number"
			name="phone" />
		<view class="box-con-clear" @click="clearPhone" v-if="phone">
			<image :src="clearImg"></image>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			phone: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				//删除图标
				clearImg: require('@/static/img/login/clear.svg')
			}
		},
		methods: {
			inputPhone(e) {
				//console.log(e.detail.value)
				this.$emit('inputPhone', e.detail.value)

			},
			clearPhone() {
				this.$emit('clearPhone')
			}
		}
	}
</script>

<style scoped lang="scss">
	.box-con {
		width: 92%;
		margin-left: 4%;
		border-bottom: 2rpx solid #eee;
		display: flex;
		height: 100rpx;
		font-size: 32rpx;
		// margin-bottom: 30rpx;

		.box-con-title {
			width: 20%;
			line-height: 100rpx;
		}

		.box-con-input {
			width: 60%;
			font-size: 32rpx;
			height: 50rpx;
			margin-top: 25rpx;
		}

		.box-con-clear {
			width: 20%;
			text-align: center;

			image {
				width: 50rpx;
				height: 50rpx;
				margin-top: 25rpx;
			}
		}

	}
</style>
